FROM dukecheng/aspnetcore:aspnetcore-runtime-2.2.0 AS base
WORKDIR /app
EXPOSE 80

FROM dukecheng/aspnetcore:aspnetcore-sdk-2.2.100 AS build
WORKDIR /src
COPY ["BaBaoFan.Modifier/BaBaoFan.Modifier.csproj", "BaBaoFan.Modifier/"]
COPY ["BaBaoFan.Modifier.Model/BaBaoFan.Modifier.Model.csproj", "BaBaoFan.Modifier.Model/"]
COPY ["BaBaoFan.Modifier.Data/BaBaoFan.Modifier.Data.csproj", "BaBaoFan.Modifier.Data/"]
COPY ["BaBaoFan.Modifier.Service/BaBaoFan.Modifier.Service.csproj", "BaBaoFan.Modifier.Service/"]
COPY ["BaBaoFan.Modifier.Common/BaBaoFan.Modifier.Common.csproj", "BaBaoFan.Modifier.Common/"]
RUN dotnet restore "BaBaoFan.Modifier/BaBaoFan.Modifier.csproj"
COPY . .
WORKDIR "/src/BaBaoFan.Modifier"
RUN dotnet build "BaBaoFan.Modifier.csproj" -c Release -o /app

FROM build AS publish
RUN dotnet publish "BaBaoFan.Modifier.csproj" -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "BaBaoFan.Modifier.dll"]